package org.example.sdk;

import org.jetbrains.annotations.NotNull;

import java.util.Iterator;

class ResourceIterable<T> implements Iterable<T> {

    private final ResourceFetcher<T> fetcher;

    public ResourceIterable(ResourceFetcher<T> fetcher) {
        this.fetcher = fetcher;
    }

    @NotNull
    @Override
    public Iterator<T> iterator() {
        return new ResourceIterator<>(fetcher);
    }

}
